package com.zs.blog.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zs.blog.model.dto.ArticleTagDTO;
import com.zs.blog.model.dto.TagDTO;
import com.zs.blog.model.entity.Tag;
import com.zs.blog.model.vo.TagListVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Title: TagMapper
 * @Author zs
 * @Package com.zs.blog.dao
 * @Date 2024/10/13 20:56
 * @description: 标签映射接口
 */
public interface ITagMapper extends BaseMapper<Tag> {

    List<ArticleTagDTO> getTagByArticleId(Long articleId);

    List<TagDTO> listTagWithPagination(Page<TagDTO> page);

    List<TagDTO> listTagBySearchCondition(Page<TagDTO> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<Tag> lqw);

    Integer getArticleCountUnderTag(List<Integer> tagIdList);

    void deleteTagByIds(List<Integer> tagIdList);

    List<TagListVO> listTag();
}
